]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st-texture-cache: Don't add NULL textures to cache
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Tue, 17 Apr 2018 09:43:34 +0000 (04:43 -0500)
committerMarco Trevisan (Treviño) <mail@3v1n0.net>
Wed, 20 Jun 2018 22:48:54 +0000 (00:48 +0200)
This might cause a crash when cleaning up the cache as the hash table has
cogl_object_unref as DestroyNotify function but that assumes that
the passed object is a valid CoglObject.

Fixes: #210
src/st/st-texture-cache.c

index e8a832df029b7a6639a8a7602e9a64f891a1b382..58185120e6d4dda969f0601c6a061a461ee4d7bc 100644 (file)
@@ -520,6 +520,8 @@ finish_texture_load (AsyncTextureLoadData *data,
     goto out;
 
   texdata = pixbuf_to_cogl_texture (pixbuf);
+  if (!texdata)
+    goto out;
 
   if (data->policy != ST_TEXTURE_CACHE_POLICY_NONE)
     {
@@ -1273,6 +1275,9 @@ st_texture_cache_load_file_sync_to_cogl_texture (StTextureCache *cache,
       texdata = pixbuf_to_cogl_texture (pixbuf);
       g_object_unref (pixbuf);
 
+      if (!texdata)
+        goto out;
+
       if (policy == ST_TEXTURE_CACHE_POLICY_FOREVER)
         {
           cogl_object_ref (texdata);